﻿using LiveCharts.Wpf;
using LiveCharts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace RecordBill.Views
{
    /// <summary>
    /// HomeView.xaml 的交互逻辑
    /// </summary>
    public partial class HomeView : UserControl
    {
        public HomeView()
        {
            InitializeComponent();
            Loaded += W_Loaded;
        }

        private void TestCirleChart()
        {
            //SeriesCollection SeriesCollection = new SeriesCollection();
            //SeriesCollection.Add(new PieSeries()
            //{
            //    Title = "高一(1)班",
            //    Values = new ChartValues<int>() { 30 },
            //    DataLabels = true,
            //    LabelPoint = new Func<ChartPoint, string>((chartPoint) =>
            //    {
            //        return string.Format("{0}{1} ({2:P})", chartPoint.SeriesView.Title, chartPoint.Y, chartPoint.Participation);
            //    })
            //});
            //SeriesCollection.Add(new PieSeries()
            //{
            //    Title = "高一(2)班",
            //    Values = new ChartValues<int>() { 50 },
            //    DataLabels = true,
            //    LabelPoint = new Func<ChartPoint, string>((chartPoint) =>
            //    {
            //        return string.Format("{0}{1} ({2:P})", chartPoint.SeriesView.Title, chartPoint.Y, chartPoint.Participation);
            //    })
            //});
            //SeriesCollection.Add(new PieSeries()
            //{
            //    Title = "高一(3)班",
            //    Values = new ChartValues<int>() { 20 },
            //    DataLabels = true,
            //    LabelPoint = new Func<ChartPoint, string>((chartPoint) =>
            //    {
            //        return string.Format("{0}{1} ({2:P})", chartPoint.SeriesView.Title, chartPoint.Y, chartPoint.Participation);
            //    })
            //});

            //s3.Series = SeriesCollection;
        }
        private void W_Loaded(object sender, RoutedEventArgs e)
        {
            TestCirleChart();
        }
    }
}
